//引入express模块
var express = require('express');
//创建路由对象 
var router = express.Router();

/* GET users listing. */
// router.get('/', function(req, res, next) {
//   res.send('user1');
// });
// router.get('/two', function(req, res, next) {
//   res.send('user2');
// });

// module.exports = router;

router.post("/login",(req,resp)=>{
  //console.log("手动登录的请求");
  //获得客户端传递归来的参数
  let username = req.body.username;
  let userPwd = req.body.userPwd;
   //console.log(username,userPwd);
   if(username==='abc' &&userPwd==='123'){
    resp.end(JSON.stringify({'code':0,'msg':'登录成功'}));
   }else{
    resp.end(JSON.stringify({'code':1,'msg':'登录失败'}));
   }
});
module.exports = router;
